package com.xbongbong.workflow.pojo;

import com.xbongbong.paas.field.FilterConditionsPoJo;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * @author chenpeng
 * @version 1.0
 * @date 2021-05-10 15:37
 * @description
 */
@Data
public class FilterCondition extends FilterConditionsPoJo {

    private static final long serialVersionUID = -6169490524062997910L;


    /**
     * 目标表单saas标识
     */
    private Integer targetSaasMark;
    /**
     * 目标表单业务类型
     */
    private Integer targetBusinessType;
    /**
     * 目标表单表单类型
     */
    private Long targetFormId;

    private Long targetWorkflowNodeId;

    /**
     * 是否是触发节点字段的标识，0:不是；1:是
     */
    @NotNull(message = "{dto.msg.triggerNodeFlag.NotNull}")
    private Integer triggerNodeFlag;

    public FilterCondition() {
    }

    public FilterCondition(Integer targetSaasMark, Integer targetBusinessType, Long targetFormId, Long targetWorkflowNodeId, Integer triggerNodeFlag,
                           @NotEmpty(message = "目标表单字段不能为空") String attr, @NotNull(message = "字段类型不能为空") Integer fieldType, String attrName,
                           @NotEmpty(message = "操作标示不能为空") String symbol, @NotNull(message = "值类型不能为空") Integer valueType,
                           Object value, String valueAttr, Integer valueFieldType, String valueAttrName, @NotEmpty(message = "搜索条件不能为空") String rel) {
        super(attr, fieldType, attrName, symbol, valueType, value, valueAttr, valueFieldType, valueAttrName, rel);
        this.targetSaasMark = targetSaasMark;
        this.targetBusinessType = targetBusinessType;
        this.targetFormId = targetFormId;
        this.targetWorkflowNodeId = targetWorkflowNodeId;
        this.triggerNodeFlag = triggerNodeFlag;
    }

    public FilterCondition(Integer triggerNodeFlag,
                           @NotEmpty(message = "目标表单字段不能为空") String attr, @NotNull(message = "字段类型不能为空") Integer fieldType, String attrName,
                           @NotEmpty(message = "操作标示不能为空") String symbol, @NotNull(message = "值类型不能为空") Integer valueType,
                           Object value, String valueAttr, Integer valueFieldType, String valueAttrName, @NotEmpty(message = "搜索条件不能为空") String rel) {
        super(attr, fieldType, attrName, symbol, valueType, value, valueAttr, valueFieldType, valueAttrName, rel);
        this.triggerNodeFlag = triggerNodeFlag;
    }


}
